package io.mft.api.domain;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;

import io.mft.commons.function.datasource.DatasourceInvokeType;
import io.mft.commons.function.response.kv.KVMap;
import io.mft.commons.util.Unique;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@JsonInclude(Include.NON_DEFAULT)
public class Regulation implements Unique,Serializable{
	 
	        /**
	 * @说明：TODO
	 * @字段名称 serialVersionUID
	        */  
	    
	private static final long serialVersionUID = 8814143397199023908L;
	//public static final String ASYNCTHREADPOOL_DEFAULT="MFT.AsyncThreadPool.default";
	private RegulationProcessClassify processClassify;
	private String value;
	private KVMap config=new KVMap();
	@JsonIgnore
	private int pos;
	private ExecuteMode executeMode=ExecuteMode.sync;//sync,syncWaitAsync,async
	private DatasourceInvokeType type=DatasourceInvokeType.none;
	private String chainConditionDriver="noneDeliverReturn";
	private boolean multipleParameterCommaSplit=false;
	private String threadExecutorId;
	public String uid() {
		String uid=pos+"."+getProcessClassify().name();
		return uid;
	}



	@Override
	public String uniqueId() {
		String k=processClassify.name()+"-"+value+"-"+executeMode+"-"+type.name()+"-"+chainConditionDriver+"-"+multipleParameterCommaSplit;
		return k;
	}
}
